<?php
namespace app\admin\model;
use \think\Model;

class Roles extends Model
{
	//设置主键
	protected $pk = 'id';
	// 设置当前模型对应的完整数据表名称
	protected $table = 'tp_auth_group';
	//类型转换
	protected $type = [
		'status'    =>  'integer',
	];
	
	protected $auto = [];
	protected $insert = ['status' => 1];
	protected $update = [];
	 
	
	//状态获取器
	public function getStatusAttr($value)
	{
		$status = [0=>'禁用',1=>'正常'];
		return $status[$value];
	}
	
	/**
	 * 获取自动增长主键
	 */
	public function getLastInsertId()
	{
		return $this->getData($this->pk);
	}
	
	
	
	
	
}
